package com.mutual.commom.zfb;

import java.io.FileWriter;
import java.io.IOException;

/* *
 *类名：AlipayConfig
 *功能：基础配置类
 *详细：设置帐户有关信息及返回路径
 *修改日期：2017-04-05
 *说明：
 *以下代码只是为了方便商户测试而提供的样例代码，商户可以根据自己网站的需要，按照技术文档编写,并非一定要使用该代码。
 *该代码仅供学习和研究支付宝接口使用，只是提供一个参考。
 */

public class AlipayConfig {
	
//↓↓↓↓↓↓↓↓↓↓请在这里配置您的基本信息↓↓↓↓↓↓↓↓↓↓↓↓↓↓↓

	// 应用ID,您的APPID，收款账号既是您的APPID对应支付宝账号
	public static String app_id = "2018092661524534";
	
	// 商户私钥，您的PKCS8格式RSA2私钥
    public static String merchant_private_key = "MIIEvAIBADANBgkqhkiG9w0BAQEFAASCBKYwggSiAgEAAoIBAQCSyvOlHGsH5QBCIwS92W7A4Fy5pLv/AMLS4eun0vVt0ShgWJa56mR7t6twBD+n49RlV5pIxeVZM0ch4IlM/OoH8j7uIUNZwP9/xn4MVuDUuFKkdPYm+JYaqCBUoQJufDEoI3D7gEf8cYhthbZN7sh4sp6swOjGGsDDUoY8RZmZZsTg7tVYlaX4SFVMVa6cxIWtr+hZw+smctaDhDvPxWvYFK2hFHNdpF5rW/I5Ci2R77EnNxjeFz7Oe2WiGkg66153uedhstXovIysid375VgIf8tsqhyFmT/eBZzt7bQfbnfFiisGmdPFbegaOQLhX2D6V4jHa8HVESvRQi2vd5kTAgMBAAECggEABtjirpP5xh9/eJZLlVN8IBEXIi21+zoc3Ftfc6+adSnpeT0Iotl1IHQ70fjQw1MUSDni33wjq5qBuenQXb/6Zq59EvyIOLqQ8HPg01CGIkYKzNML3FuCHPI0t93e0CqI3HdywLiGIxdkpr8y9sWpoj+quSIyeXMsBLBnxI32kTow3/IB0TWRUzSkzYI8YVVMWRjX2iiBh/8WRrG1cX+/H4javDMszqgVg4YsRXiaAC0BnFq2cHTo0wOS6pw7+c4K3TqbSCSl6IrqDUOQ77Rl9BYx3hXHpo7tfTodycT4ZfK0R4P49pAFOYmLFNH67mKdiKInGW41xkpU1Umd4WGR4QKBgQDLL4D5G4J7L4Bw8tq7beJG5p614T9BZnDQXVCxoCUys15G7QQZoB1LtV1XjHj/2X+XKY3RVkdXrUtbEE4cdLKEgnxqydgVB+3Bg7EbjSrPrQF0KI9tVN0aqgGQzCLXMMcMhVXulojaaiApPa7WODX+KZfLSe6s9S7nrabU6LcHQwKBgQC48uzqyqaXqw4ROPwsakiwTIlJqtE6v99U+A+E5JOxiouAqK603bGZkZfJLkthvjcsuAtb3Z5jPfYuZVFbFdwCTIs9jmXC3ztGFAbie65ATGhSDPKYDJf29urBhvkoju2Tbb0dUxfGZQmHDwf54eSj8jA6d++KPT9gj0L8EuuB8QKBgAOhZqmMz0kKMT5TaIsezIM9zaosSygM/4kJkc6KsP916wJTa9ZVYRCgPfm5fdP8e+YkjO8nnoC3jPgkk3C4uRPbDQQPdTfy+1GQ29JFNHWffr4nl2B5urWmQf7nVtwHeBcGLuHjeLCGYuq5um0DdhuDfL3aJVSb0Om81ZVKTzLnAoGAOr8nFBlUu15hNIVGTJFiD2XwQc8ZcLDbrrCwtUSpyT45u59ZByhYLnB5pzSmSyDRg8neCcsmcV2QIgKayfTykmRf4iimGDUyLbtUyIICwnfCtzVXpYZyisa5oMlPwVtNCYRVCsiHB8S2NwlGPlBLgOv/98J6+w0jYXeADnOwDPECgYANYXXu3ntevi7VuIiKDyJ9LtEITlyIicCO/Na9OlbaendU2utsANjXhqZKKKsTFokrGHJrK2rAg/tu2somNHM8li04IjNk0IkC0J3rXoCn7fjoioXyXWp91fNOY7PaRkexdrXjMkLANk40cKOMrXjEU3w9GBN4rl36cRx39VRFbA==";
	
	// 支付宝公钥,查看地址：https://openhome.alipay.com/platform/keyManage.htm 对应APPID下的支付宝公钥。
    										
    public static String alipay_public_key = "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvhgD3QKDkcfLWg9xbf7xE9wcJlk9OnDOPUskPZxXaWRDbYEMMjY8ZpvYUpjDg2TdCaviM5wxB/RMZUldMT2Itnlv8v3mmXgY6Mz7VWDgOklXXODkaU8Qs+mmy6aMrVz0mNNfhwElKfdwAXl3fV7ZGNE4yMgm0uziqVh7qUDnj8WyaZnUOAieNPqHpAptngIMRmfeqdKFYStgpj06kY37gA8rRO6yS1nUMfJqI0tHaRD6CTao8MdOW/C/rPCbyH8PtY46sKru/xkyp37ZuHipD3It6fZsXnIBvOi+LOH2X72xvXZSXF0KQMcc/eKQXxBIo1eZuHL15ndlUNy2izmchwIDAQAB";

	// 服务器异步通知页面路径  需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
    public static String notify_app_url = "http://60.205.200.79:8080/payment/zhiFuBaoNotifyAction";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_pc_url = "http://www.mayiyuedu.com.cn/webSite/alreadyLogin/paymentSuccessReturn.do";

	// 页面跳转同步通知页面路径 需http://格式的完整路径，不能加?id=123这类自定义参数，必须外网可以正常访问
	public static String return_app_url = "http://60.205.200.79:8080/payment/returnZhiFuBao";
	
	// 签名方式
	public static String sign_type = "RSA2";
	
	// 字符编码格式
	public static String charset = "utf-8";
	
	// 编码
	public static String CHARSET = "UTF-8";
	// 返回格式
	public static String FORMAT = "json";
	
	// 支付宝网关
	//https://openapi.alipaydev.com/gateway.do 测试环境
	//https://openapi.alipay.com/gateway.do 正式环境
	public static String gatewayUrl = "https://openapi.alipay.com/gateway.do";  
	
	// 支付宝网关
	public static String log_path = "C:\\";


//↑↑↑↑↑↑↑↑↑↑请在这里配置您的基本信息↑↑↑↑↑↑↑↑↑↑↑↑↑↑↑

    /** 
     * 写日志，方便测试（看网站需求，也可以改成把记录存入数据库）
     * @param sWord 要写入日志里的文本内容
     */
    public static void logResult(String sWord) {
        FileWriter writer = null;
        try {
            writer = new FileWriter(log_path + "alipay_log_" + System.currentTimeMillis()+".txt");
            writer.write(sWord);
        } catch (Exception e) {
            e.printStackTrace();
        } finally {
            if (writer != null) {
                try {
                    writer.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}

